import Vue from 'vue';
import VueRouter from 'vue-router';

const Home = () => import('@/pages/home/home');
const Category = () => import('@/pages/category/category');
const Cart = () => import('@/pages/cart/cart');
const Profile = () => import('@/pages/profile/profile');
const Detail = () => import('@/pages/detail/detail');


Vue.use(VueRouter);

const routes = [
  {
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/category',
    component: Category
  },
  {
    path: '/cart',
    component: Cart
  },
  {
    path: '/profile',
    component: Profile
  },
  {
    path: '/detail/:iid',
    component: Detail
  }
];

const router = new VueRouter({
  routes
})

export default router;